package com.bestcem.xm.survey.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bestcem.xm.component.mybatis.base.BaseEntity2;
import com.bestcem.xm.component.mybatis.format.String2JacksonSerializer;
import com.bestcem.xm.survey.config.StringValue2FastJsonSerializer;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @TableName ds_survey_filter
 */
@TableName(value = "ds_survey_filter")
@Data
@EqualsAndHashCode(callSuper = true)
public class SurveyFilter extends BaseEntity2 {
    
    @TableId(value = "id")
    private String id;

    /**
     * 问卷ID
     */
    @TableField(value = "project_id")
    @JsonProperty("project_id")
    @JSONField(name = "project_id")
    private String projectId;

    /**
     * 状态
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 答卷来源列表
     */
    @TableField(value = "sourceList")
    @JsonProperty("sourceList")
    @JsonSerialize(using = String2JacksonSerializer.class)
    @JSONField(name = "sourceList", serializeUsing = StringValue2FastJsonSerializer.class)
    private String sourcelist;

    /**
     * 所属层级列表
     */
    @TableField(value = "groupList")
    @JsonProperty("groupList")
    @JsonSerialize(using = String2JacksonSerializer.class)
    @JSONField(name = "groupList", serializeUsing = StringValue2FastJsonSerializer.class)
    private String grouplist;

    /**
     * 问题筛选条件，key为题目下拉框的id
     */
    @TableField(value = "qlist")
    @JsonSerialize(using = String2JacksonSerializer.class)
    @JSONField(serializeUsing = StringValue2FastJsonSerializer.class)
    @JsonProperty("qList")
    private String qlist;

    /**
     * 自定义筛选条件，key为自定义id
     */
    @TableField(value = "condList")
    @JsonSerialize(using = String2JacksonSerializer.class)
    @JSONField(name = "condList", serializeUsing = StringValue2FastJsonSerializer.class)
    private String condlist;

    /**
     * 问题逻辑关系 and/or
     */
    @TableField(value = "qLogic")
    @JsonProperty("qLogic")
    @JSONField(name = "qLogic")
    private String qlogic;

    /**
     * 自定义条件逻辑关系 and/or
     */
    @TableField(value = "condLogic")
    @JsonProperty("condLogic")
    @JSONField(name = "condLogic")
    private String condlogic;

    /**
     * 外部参数筛选条件
     */
    @TableField(value = "ext")
    @JsonSerialize(using = String2JacksonSerializer.class)
    @JSONField(serializeUsing = StringValue2FastJsonSerializer.class)
    private String ext;

    /**
     * 筛选设置
     */
    @TableField(value = "action")
    private Integer action;
}